#include "Health.h"

Health::Health()
	: mActive(true)
	, mHealth(10)
{
	
};

Health::~Health()
{

};

void Health::Load()
{
	mSprite.Add("healthbar_01.png");
	mSprite.Add("healthbar_02.png");
	mSprite.Add("healthbar_03.png");
	mSprite.Add("healthbar_04.png");
	mSprite.Add("healthbar_05.png");
	mSprite.Add("healthbar_06.png");
	mSprite.Add("healthbar_07.png");
	mSprite.Add("healthbar_08.png");
	mSprite.Add("healthbar_09.png");
	mSprite.Add("healthbar_10.png");
}; // initialize

void Health::Unload()
{
	mSprite.Unload();
}; // terminate

void Health::Render(const SVector2& offset)
{
	const int kWinWidth = IniFile_GetInt("WinWidth", 800);
	const int kWinHeight = IniFile_GetInt("WinHeight", 600);

	SVector2 startPosition(kWinWidth * 0.06f, (int)(kWinHeight * 0.1f));
	if (mHealth > 0 && mHealth <= 10)
		mSprite.SetCurrentFrame(mHealth - 1);

	mSprite.SetPosition(startPosition);
	mSprite.Render();
};